<?php
/*
 * Author: Quan Van Sinh
 * Email: sinhvnb@vietnambiz.com
 * Update: NghiaTruong
 * Email: nghiatruong@vietnambiz.com
 * Date: 16-3-2011
 */
class searchlog{

    function searchlog(){}

    function getAllKeyword(){
        global $db,$config;
        $sqlTotalRows="SELECT keyword FROM search_keyword";
        $totalRows =  $db->num_rows($db->query($sqlTotalRows));
        $totalPages = ceil($totalRows/$config ['total_article_on_admin']);

        $start = (($config ['page']*$config ['total_article_on_admin'])-$config ['total_article_on_admin']);
        $limit = $config ['total_article_on_admin'];
        $sql = "SELECT keyword,count FROM search_keyword ORDER BY count DESC LIMIT $start,$limit";
        $rs = $db->query($sql);
        return Array("rs"=>$rs,"totalRows"=>$totalRows);
    }
}
?>
